package org.tulkas.web.ui;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.tulkas.ext.IConfigExtensionPoint;

/**
 * @author <a href="mailto:tulkas.web@gmail.com">Tulkas</a>
 *
 */
@Service
public class MainMenuExtPoint implements IConfigExtensionPoint {
	public static final String PARAM_TITLE = "title";
	public static final String PARAM_LINK = "link";
	public static final String PARAM_ORDER = "order";

	private static final Map<String, String> PARAMS = new HashMap<String, String>();

	static {
		PARAMS.put(PARAM_TITLE,
				"Title of the menu item, will be displayed in the main menu.");
		PARAMS.put(PARAM_LINK, "URL link of the menu item.");
		PARAMS
				.put(PARAM_ORDER,
						"Order number of the menu item, which decides where to display the menu");
	}

	/* (non-Javadoc)
	 * @see org.tulkas.extension.IConfigExtensionPoint#getParamDescription(java.lang.String)
	 */
	@Override
	public String getParamDescription(String name) {
		return PARAMS.get(name);
	}

	/* (non-Javadoc)
	 * @see org.tulkas.extension.IConfigExtensionPoint#getParamNames()
	 */
	@Override
	public String[] getParamNames() {
		return PARAMS.keySet().toArray(new String[PARAMS.size()]);
	}

	/* (non-Javadoc)
	 * @see org.tulkas.extension.IExtensionPoint#getDescription()
	 */
	@Override
	public String getDescription() {
		return "Menu items of the main menu";
	}
}
